﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace OnlineCourse.Model.Entity
{
    /// <summary>
    /// 课程
    /// </summary>
    public class Course
    {
        public Course()
        {
            this.CreateDate = DateTime.Now;
            this.UpdateDate = DateTime.Now;
        }
        public Guid Id { get; set; }
        /// <summary>
        /// 讲师ID
        /// </summary>
        public Guid TeacherId { get; set; }
        public Teacher Teacher { get; set; }
        /// <summary>
        /// 课程名称
        /// </summary>
        [MaxLength(150)]
        public string Title { get; set; }
        /// <summary>
        /// 课程类型（1新闻，2视频课程，3精品专栏，4精品微课，）
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// 课程标题图片路径
        /// </summary>
        [MaxLength(200)]
        public string ImagePath { get; set; }
        /// <summary>
        /// 详细信息
        /// </summary>
        [DataType(DataType.Text)]
        public string Detailed { get; set; }
        /// <summary>
        /// 购买价格
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 购买人数
        /// </summary>
        public int BuyNum { get; set; }
        /// <summary>
        /// 课时情况
        /// </summary>
        [MaxLength(50)]
        public string LessonHour { get; set; }
        public DateTime CreateDate { get; set; }
        public DateTime UpdateDate { get; set; }
        /// <summary>
        /// 课程章节集合
        /// </summary>
        public ICollection<Section> Section { get; set; }
        /// <summary>
        /// 收藏集合
        /// </summary>
        public ICollection<LikeCollection> LikeCollections { get; set; }
        /// <summary>
        /// 课程购买集合
        /// </summary>
        public ICollection<BuyOrder> BuyOrders { get; set; }
    }
}
